<!DOCTYPE html>
<html>

<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
	<title></title>
	<style type="text/css">
		* {
			padding: 0;
			margin: 0;
		}

		button {
			/* pointer-events: none; */
			cursor: pointer;
		}

		.bbb {
			pointer-events: none;
			width: 100vw;
			height: 100vh;
			position: fixed;
			top: 0;
			left: 0;
			opacity: 0.3;
			background: #000;
		}
	</style>
</head>

<body>
	<div class="aaa">
		<button onclick="btn()">aaa</button>

		<h4>点击穿透 pointer-events: none; 默认 auto</h4>
	</div>
	<div class="bbb" onclick="bbb()"></div>
</body>

</html>
<script type="text/javascript">
	function btn (params) {
		console.log('btn');
	}

	function bbb () {
		console.log('bbb');
	}


	(function ($, Drupal) {
			const fileInput = $('input.ck-hidden[type="file"]');
			// Remove any existing change event handlers
			fileInput.on(
				'change',
				// eslint-disable-next-line func-names
				function (event) {
					const files = event.currentTarget.files;

					// Assuming you want to check the size of the first selected file
					const selectedFile = files[0];

					// Set your maximum file size limit (in bytes)
					const maxSizeInBytes = 1024 * 1024; // 1 MB as an example, adjust as needed

					if (selectedFile && selectedFile.size > maxSizeInBytes) {
						// eslint-disable-next-line no-alert
						alert(
							'File size exceeds the allowed limit. Please select a smaller file.',
						);
						// Reset the file input to clear the selection
						$(event.target).val('');
					} else {
						// Continue with CKEditor's default behavior
						// Trigger CKEditor's code to handle the file upload
						// For example, you can trigger a click event on the CKEditor button
						const ckButton = $('.ck-file-dialog-button button', context);
						if (ckButton.length) {
							ckButton.click();
						}
					}
				},
			);
		})(jQuery);

</script>